﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.PlanningManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.PlanningManagement.ProductionTaskVMs
{
    public partial class ProductionTaskTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ProductionTask._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ProductId);
        [Display(Name = "_Model._ProductionTask._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ProductName);
        [Display(Name = "_Model._ProductionTask._Wo")]
        public ExcelPropety Wo_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.Wo);
        [Display(Name = "_Model._ProductionTask._LineId")]
        public ExcelPropety LineId_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.LineId);
        [Display(Name = "_Model._ProductionTask._LineCode")]
        public ExcelPropety LineCode_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.LineCode);
        [Display(Name = "_Model._ProductionTask._ShiftId")]
        public ExcelPropety ShiftId_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ShiftId);
        [Display(Name = "_Model._ProductionTask._ShiftCode")]
        public ExcelPropety ShiftCode_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ShiftCode);
        [Display(Name = "_Model._ProductionTask._ProductCode")]
        public ExcelPropety ProductCode_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ProductCode);
        [Display(Name = "_Model._ProductionTask._OpId")]
        public ExcelPropety OpId_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.OpId);
        [Display(Name = "_Model._ProductionTask._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.OpCode);
        [Display(Name = "_Model._ProductionTask._ProductionBatch")]
        public ExcelPropety ProductionBatch_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ProductionBatch);
        [Display(Name = "_Model._ProductionTask._ProdOrder")]
        public ExcelPropety ProdOrder_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ProdOrderId);
        [Display(Name = "_Model._ProductionTask._TaskStatus")]
        public ExcelPropety TaskStatus_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.TaskStatus);
        [Display(Name = "_Model._ProductionTask._OnlineQty")]
        public ExcelPropety OnlineQty_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.OnlineQty);
        [Display(Name = "_Model._ProductionTask._PlanQty")]
        public ExcelPropety PlanQty_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.PlanQty);
        [Display(Name = "_Model._ProductionTask._QualifiedQty")]
        public ExcelPropety QualifiedQty_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.QualifiedQty);
        [Display(Name = "_Model._ProductionTask._UnqualifiedQty")]
        public ExcelPropety UnqualifiedQty_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.UnqualifiedQty);
        [Display(Name = "_Model._ProductionTask._ScrapQty")]
        public ExcelPropety ScrapQty_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.ScrapQty);
        [Display(Name = "_Model._ProductionTask._CompletedQty")]
        public ExcelPropety CompletedQty_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.CompletedQty);
        [Display(Name = "_Model._ProductionTask._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.CreateTime, true);
        [Display(Name = "_Model._ProductionTask._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ProductionTask._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.CreateBy);
        [Display(Name = "_Model._ProductionTask._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.UpdateBy);
        [Display(Name = "_Model._ProductionTask._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.IsValid);
        [Display(Name = "_Model._ProductionTask._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ProductionTask>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            ProdOrder_Excel.DataType = ColumnDataType.ComboBox;
            ProdOrder_Excel.ListItems = DC.Set<ProductionOrder>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProductionTaskImportVM : BaseImportVM<ProductionTaskTemplateVM, ProductionTask>
    {
            //import

    }

}